//
//  HHUserConfig.m
//  InternetHospital
//
//  Created by chun.chen on 2022/2/14.
//  Copyright © 2022 HC. All rights reserved.
//

#import "HHUserConfig.h"
#import "HHUserPrivate.h"

@implementation HHUserConfig

///MARK: - systen
- (instancetype)init {
    self = [super init];
    if (self) {
    }
    return self;
}

///MARK: - HHUserConfigProtocol
/// 用户初始配置
- (void)hh_userSetup {
    if ([self.configDelegate respondsToSelector:@selector(hh_userSetup)]) {
        [self.configDelegate hh_userSetup];
    }
}

- (BOOL)synchroniseHuanxinLogin {
    if ([self.configDelegate respondsToSelector:@selector(synchroniseHuanxinLogin)]) {
        return [self.configDelegate synchroniseHuanxinLogin];
    }
    return YES;
}

- (BOOL)synchroniseUserData {
    if ([self.configDelegate respondsToSelector:@selector(synchroniseUserData)]) {
        return [self.configDelegate synchroniseUserData];
    }
    return YES;
}

///MARK: - URL
- (NSString *)userGenLoginKeyURL {
    NSString *res = @"login/genLoginKey";
    if ([self.configDelegate respondsToSelector:@selector(userLoginURL)]) {
        res = [self.configDelegate userLoginURL] ? : @"";
    }
    return res;
}

- (NSString *)userGetPublicKeyURL {
    NSString *res = @"login/getPublicKey";
    if ([self.configDelegate respondsToSelector:@selector(userLoginURL)]) {
        res = [self.configDelegate userLoginURL] ? : @"";
    }
    return res;
}

- (NSString *)userLoginURL {
    NSString *res = @"login";
    if ([self.configDelegate respondsToSelector:@selector(userLoginURL)]) {
        res = [self.configDelegate userLoginURL] ? : @"";
    }
    return res;
}

- (NSString *)userCenterURL {
    NSString *res = @"user/center";
    if ([self.configDelegate respondsToSelector:@selector(userLoginURL)]) {
        res = [self.configDelegate userLoginURL] ? : @"";
    }
    return res;
}

- (NSString *)sendSmsURL {
    NSString *res = @"sendSms";
    if ([self.configDelegate respondsToSelector:@selector(sendSmsURL)]) {
        res = [self.configDelegate sendSmsURL] ? : @"";
    }
    return res;
}

- (NSString *)validLoginURL {
    NSString *res = @"login/validLogin";
    if ([self.configDelegate respondsToSelector:@selector(validLoginURL)]) {
        res = [self.configDelegate validLoginURL] ? : @"";
    }
    return res;
}

///MARK: - KEY
- (NSString *)userIdenitiesKey {
    if ([self.configDelegate respondsToSelector:@selector(userIdenitiesKey)]) {
        return [self.configDelegate userIdenitiesKey];
    }
    return kHHUser_identitedKey;
}

- (NSString *)userDataKey {
    if ([self.configDelegate respondsToSelector:@selector(userDataKey)]) {
        return [self.configDelegate userDataKey];
    }
    return kHHUser_dataKey;
}

- (NSString *)userSmsSecretKey {
    if ([self.configDelegate respondsToSelector:@selector(userSmsSecretKey)]) {
        return [self.configDelegate userSmsSecretKey];
    }
    return @"wu268m4iu8phczre4b";
}

@end
